package org.feiye.studyday04.practise;

import java.util.Scanner;

public abstract class Travel {

	public static void main(String[] args) {
		// 书上第三章练习3
		double price = 5000;
		Scanner sc = new Scanner(System.in);
		int month,choose;
		System.out.println("请输入您出行的月份：");
		month = sc.nextInt();
		if(month>=1&&month<=12) {
			if (month <= 10 && month >= 4) {
				System.out.println("请问您选择头等舱还是经济舱？头等舱输入1，经济舱输入2：");
				choose = sc.nextInt();
				if (choose == 1) {
					price = price * 0.9;
					System.out.println("您的机票价格为：" + price);
				} else if (choose == 2) {
					price = price * 0.6;
					System.out.println("您的机票价格为：" + price);
				} else {
					System.out.println("输入有误！");
				}
			} else {
				System.out.println("请问您选择头等舱还是经济舱？头等舱输入1，经济舱输入2：");
				choose = sc.nextInt();
				if (choose == 1) {
					price = price * 0.5;
					System.out.println("您的机票价格为：" + price);
				} else if (choose == 2) {
					price = price * 0.4;
					System.out.println("您的机票价格为：" + price);
				} else {
					System.out.println("输入有误！");
				}
			}
		} else {
			System.out.println("无此月份！");
		}
		}
}
